package com.jash.lifxdemo;

import android.Manifest;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.jash.lifxdemo.databinding.ActivityMainBinding;

public class MainActivity extends AppCompatActivity {
    private ActivityMainBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        String[] titles = {"推荐","NBA","中国足球","国际足球",
                "中国篮球","综合","视频","最“董”球","电竞",
                "图说","网球","羽毛球","高尔夫","深度","竞猜",
                "铿锵玫瑰"};
        NewsAdapter adapter = new NewsAdapter(getSupportFragmentManager(), titles);
        binding.pager.setAdapter(adapter);
        binding.tab.setupWithViewPager(binding.pager);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            int i = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
        }
    }
}
